<ion-view title="账号管理" show-tabs>
  <ion-nav-buttons side="right">
      <button class="button margin-right" ng-click="toggleEdit()" ng-class="{'button-icon ion-ios-trash-outline':!showEdit}"><span ng-if="showEdit">完成</span></button>
      <button class="button button-icon ion-android-add" ng-click="openModal()"></button>
  </ion-nav-buttons>

  <ion-content class="has-header">
    <ion-list can-swipe="listCanSwipe" show-delete="showEdit" class="editable-list text-center">

    <ion-item class="margin-bottom-large item-button-right text-left">
      已启用账号：<span class="balanced">{{myUsers.length + 1}}</span> / {{company.users_num}}
      </ion-item>
      <ion-item class="item-divider">
        <div class="row row-nopadding">
          <div class="col">账号</div>
          <div class="col">职位</div>
          <div class="col">员工</div>
        </div>
      </ion-item>
      <ion-item ng-repeat="myUser in myUsers" href="#/user-{{myUser._id}}">
        <div class="row row-nopadding">
          <div class="col">{{myUser.username}}</div>
          <div class="col">{{myUser.profile.roleName}}</div>
          <div class="col">{{myUser.employee_name}}<span ng-if="!myUser.profile.employee_id" class="assertive">未分配</span></div>
        </div>
        <ion-option-button class="button-assertive" ng-click="copy(myUser)">复制信息</ion-option-button>
        <ion-delete-button class="icon ion-minus-circled" ng-click="delete(myUser._id)"></ion-delete-button>
      </ion-item>

      <button class="button button-block button-balanced" ng-click="openModal()"><i class="ion-plus"></i> 添 加</button>
    </ion-list>
    <p class="padding-top text-center dark2">操作 : 左滑列表项可更新或删除 </p>
  </ion-content>
</ion-view>
